package com.lc202407;

public class Solution2535 {
    public int differenceOfSum(int[] nums) {
        int total = 0;
        int all = 0;
        for (int num : nums) {
            total += num;
            int tmp = num;
            while (tmp / 10 != 0) {
                all += tmp % 10;
                tmp /= 10;
            }
            all += tmp;
        }
        return Math.abs(total - all);
    }
}
